<template>
  <card :header="false">
    <template #filter>
      <BillNumberRulesSearch
        ref="search"
        @search="searchEvent"
        @receipttypeList="receipttypeList"
      />
    </template>
    <BillNumberRulesTableArea
      ref="table"
      @edit="editEvent"
      @detail="detailEvent"
    />
    <BillNumberRulesDialog
      ref="dialog"
      @refresh="refreshEvent"
    />
  </card>
</template>
<script>
import BillNumberRulesSearch from './components/BillNumberRulesSearch'
import BillNumberRulesTableArea from './components/BillNumberRulesTableArea'
import BillNumberRulesDialog from './components/BillNumberRulesDialog'
export default {
  name: 'BillNumberRules',
  components: { BillNumberRulesSearch, BillNumberRulesTableArea, BillNumberRulesDialog },
  data() {
    return {
      searchForm: {}
    }
  },
  methods: {
    // 搜索
    searchEvent(val) {
      this.$refs.table.query(val)
    },
    // 编辑
    editEvent(row) {
      this.$refs.dialog.getInfo(row.lngreceiptruleid)
      this.$refs.dialog.show()
      this.$refs.dialog.pageType = 'edit'
    },
    // 查看
    detailEvent(row) {
      this.$refs.dialog.getInfo(row.lngreceiptruleid)
      this.$refs.dialog.show()
      this.$refs.dialog.pageType = 'detail'
    },
    // 刷新
    refreshEvent() {
      this.$refs.table.queryListByPage()
    },
    // 单据类型下拉
    receipttypeList(val) {
      this.$refs.dialog.receipttypeList = val
    }
  }
}
</script>
